/*
 ============================================================================
 Name		: FullScreenAppView.cpp
 Author	  : 
 Copyright   : Your copyright notice
 Description : Application view implementation
 ============================================================================
 */

// INCLUDE FILES
#include <coemain.h>
#include "FullScreenAppView.h"

// ============================ MEMBER FUNCTIONS ===============================

// -----------------------------------------------------------------------------
// CFullScreenAppView::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CFullScreenAppView* CFullScreenAppView::NewL(const TRect& aRect)
	{
	CFullScreenAppView* self = CFullScreenAppView::NewLC(aRect);
	CleanupStack::Pop(self);
	return self;
	}

// -----------------------------------------------------------------------------
// CFullScreenAppView::NewLC()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CFullScreenAppView* CFullScreenAppView::NewLC(const TRect& aRect)
	{
	CFullScreenAppView* self = new (ELeave) CFullScreenAppView;
	CleanupStack::PushL(self);
	self->ConstructL(aRect);
	return self;
	}

// -----------------------------------------------------------------------------
// CFullScreenAppView::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CFullScreenAppView::ConstructL(const TRect& aRect)
	{
	// Create a window for this application view
	CreateWindowL();

	// Set the windows size
	SetRect(aRect);

	// Activate the window, which makes it ready to be drawn
	ActivateL();
	}

// -----------------------------------------------------------------------------
// CFullScreenAppView::CFullScreenAppView()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CFullScreenAppView::CFullScreenAppView()
	{
	// No implementation required
	}

// -----------------------------------------------------------------------------
// CFullScreenAppView::~CFullScreenAppView()
// Destructor.
// -----------------------------------------------------------------------------
//
CFullScreenAppView::~CFullScreenAppView()
	{
	// No implementation required
	}

// -----------------------------------------------------------------------------
// CFullScreenAppView::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
void CFullScreenAppView::Draw(const TRect& /*aRect*/) const
	{
	// Get the standard graphics context
	CWindowGc& gc = SystemGc();
	
	gc.SetBrushColor( TRgb(0, 0, 0) );
	gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
	
	TRect drawRect(Rect());
	
	gc.DrawRect( drawRect );
	
	TRect framerc = Rect();

	framerc.Shrink( 5, 5 );
	
	gc.SetPenColor( TRgb( 255, 0, 0 ) );
	
	gc.DrawRoundRect( framerc, TSize( 10, 10 ) );
	
	}

// -----------------------------------------------------------------------------
// CFullScreenAppView::SizeChanged()
// Called by framework when the view size is changed.
// -----------------------------------------------------------------------------
//
void CFullScreenAppView::SizeChanged()
	{
	DrawNow();
	}

// -----------------------------------------------------------------------------
// CFullScreenAppView::HandlePointerEventL()
// Called by framework to handle pointer touch events.
// Note: although this method is compatible with earlier SDKs, 
// it will not be called in SDKs without Touch support.
// -----------------------------------------------------------------------------
//
void CFullScreenAppView::HandlePointerEventL(const TPointerEvent& aPointerEvent)
	{

	// Call base class HandlePointerEventL()
	CCoeControl::HandlePointerEventL(aPointerEvent);
	}

// End of File
